class A {
  name: string;
  constructor(name: string) {
    this.name = name;
  }
}

class C {
  name: string;
  constructor(name: string) {
    this.name = name;
  }
}

class Container {
  mo: any;
  constructor() {
    this.mo = {};
  }

  provide(name: string, obj: any) {
    this.mo[name] = obj;
  }

  get(name: string) {
    return this.mo[name];
  }
}

const container = new Container();
container.provide('a', new A('a'));
container.provide('c', new C('c'));

class B {
  a: any;
  constructor(container: Container) {
    this.a = container.get('a');
  }
}
